﻿<link rel="stylesheet" href="<%=Aspfm.MainController.PageTool.LinkFile("Aspfm.JSPlugin/kindeditor/themes/default/default.css") %>" />
<link rel="stylesheet" href="<%=Aspfm.MainController.PageTool.LinkFile("Aspfm.JSPlugin/kindeditor/plugins/code/prettify.css") %>" />
<script charset="utf-8" src="<%=Aspfm.MainController.PageTool.LinkFile("Aspfm.JSPlugin/kindeditor/kindeditor.js") %>"></script>
<script charset="utf-8" src="<%=Aspfm.MainController.PageTool.LinkFile("Aspfm.JSPlugin/kindeditor/lang/zh-CN.js") %>"></script>
<script charset="utf-8" src="<%=Aspfm.MainController.PageTool.LinkFile("Aspfm.JSPlugin/kindeditor/plugins/code/prettify.js") %>"></script>
<script>
	var KindEditor_options = {
				cssPath : '<%=Aspfm.MainController.PageTool.LinkFile("Aspfm.JSPlugin/kindeditor/plugins/code/prettify.css") %>',
				uploadJson : '<%=Aspfm.MainController.PageTool.GetWebBaseUrl(false) %>/Aspfm.JSPlugin/kindeditor/asp.net/upload_json.ashx',
				fileManagerJson : '<%=Aspfm.MainController.PageTool.GetWebBaseUrl(false) %>/Aspfm.JSPlugin/kindeditor/asp.net/file_manager_json.ashx',
				allowFileManager : true
	};  
	var editorList = new Object();
	KindEditor.ready(function(K) {
		for (var tempKey in editorList){
			editorList[tempKey]=K.create('#'+tempKey, KindEditor_options);
			var autoheight=editorList[tempKey].edit.doc.body.scrollHeight;//此处的editor为kindeditor  
			editorList[tempKey].edit.setHeight(autoheight);  
    	}
		prettyPrint();
	});
	function setKindEditorHtml(id)
	{
		if(editorList[id])
		{
			editorList[id].html(Aspfm.Data.Form[id]);
		}
	}
	function getKindEditorHtml(id)
	{
		if(editorList[id])
		{
			Aspfm.Data.Form[id]=editorList[id].html();
		}
	}
</script>